class Player
  attr_accessor :name
  attr_accessor :location
  attr_accessor :sessions
  attr_accessor :password

  def initialize(options = [])
    @name = "Nobody"
    @location = "nowhere"
    @sessions = []
    @password = "unguessable"
    options.each do |key,value|
      @name = value if key == :name
      @location = value if key == :location
      @password = value if key == :password
    end
  end

  def boot_player()
    $client.boot_player(@session_id)
  end

  def tell(msg)
    @sessions.each do |session|
      $client.send_text(session, msg.to_s)
    end
  end

  def tell_lines(msg)
    msg.to_a.each do |line|
      tell(line)
    end
  end
end
